package com.cloudcross.ssp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.rpt.BannerRpt;
import com.cloudcross.ssp.model.rpt.Report;
import com.cloudcross.ssp.service.IRptBannerService;

@Service
public class RptBannerService implements IRptBannerService{
	
	 @Autowired
	 private GenericIBatisDao myBatisDao;

	@Override
	public List<BannerRpt> queryBannerDataByConditon(Map<String, Object> condition, Pager pager) {
		String namespace = "";
        if (pager == null) {
            namespace = "rptSqlMapper.queryBannerDataExcelByCondition";
        } else {
            namespace = "rptSqlMapper.queryRptBanner";
            condition.put("pager", pager);
        }
        return this.myBatisDao.getList(namespace, condition);
	}

	@Override
	public int queryBannerCountByCondition(Map<String, Object> condition) {
		return this.myBatisDao.get("rptSqlMapper.queryRptBannerCount", condition);
	}

	@Override
	public Report queryBannerTotalByCondition(Map<String, Object> condition) {
		return this.myBatisDao.get("rptSqlMapper.queryBannerTotalByCondition", condition);
	}

}
